package com.itheima.io.bufferedinputstream.demo02;

import java.io.BufferedInputStream;
import java.io.FileInputStream;
import java.io.FileNotFoundException;
import java.io.IOException;

public class BufferedInputStreamDemo01 {

    public static void main(String[] args) throws IOException {

        BufferedInputStream bufferedInputStream = new BufferedInputStream(new FileInputStream("itheima-io-bufferedinputstream\\a.txt"));

        byte[] bytes = new byte[1024];

        int len = -1;
        while ((len = bufferedInputStream.read(bytes)) != -1) {
            System.out.print(new String(bytes, 0, len));
        }

        bufferedInputStream.close();

    }

}
